<template>
  <el-container class="container">
    <!-- 头部 -->
    <el-header>
      <el-row>
        <el-col :span="11"
          ><el-button
            icon="el-icon-d-arrow-right"
            circle
            style="margin-top: 10px"
            @click="drawer = true"
          ></el-button
        ></el-col>

        <el-col class="logout" :span="12">
          <template>
            <el-col :span="16"
              ><div class="navOperater">
                <el-avatar
                  class="avatar"
                  src="https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png"
                  style="margin-top: 3px"
                ></el-avatar></div
            ></el-col>
            <el-col :span="4">
              <el-button
                type="primary"
                round
                style="margin-top: 5px"
                @click="con()"
                >{{ username.username }}</el-button
              >
            </el-col>
            <el-col :span="4"
              ><div class="navOperater">
                <el-link type="info" style="margin-top: 3px">退出系统</el-link>
              </div></el-col
            >
          </template>
        </el-col>
      </el-row>
    </el-header>
    <el-container>
      <!-- 侧边栏 -->
      <el-drawer
        :visible.sync="drawer"
        :with-header="true"
        size="230px"
        direction="ltr"
        ><el-aside width="230px"> <Aside /> </el-aside
      ></el-drawer>

      <!-- 内容区 -->
      <el-main>
        <template><router-view></router-view></template>
      </el-main>
    </el-container>
  </el-container>
</template>

<script>
// 导入组件
import Aside from "@/components/aside/index.vue";

export default {
  name: "dashboard",
  components: {
    Aside
  },
  data() {
    return {
      drawer: true,
      username: this.$store.getters.getUser,
      fits: ["fill", "contain", "cover", "none", "scale-down"]
    };
  },
  methods: {
    con() {
      console.log(tableData);
    }
  }
};
</script>
<style lang="scss" scoped>
body > .el-container {
  margin-bottom: 40px;
}
.container {
  height: 600px;
}
.el-header {
  text-align: left;
  background-color: white;
  .logout {
    text-align: right;
    .navOperater {
      width: 80px;
      height: 80px;
      float: right;
      line-height: 50px;
    }
  }
}
.el-main {
  background-color: #e9eef3;
  /*text-align: center;*/
}
#module {
  height: 100%;
}
#app,
html,
body,
.el-container {
  height: 100%;
}
#app,
html,
body,
.el-container {
  height: 100%;
}
</style>
